Project: Battle of Denver Neighborhoods

By: Roman Kandirovskiy

Questions, Comments, Suggestions? Reach out to me on LinkedIn

Date: June 2021

Table of contents

Introduction/Business Problem

Moving to a new city that one has never been to and choosing a new place to live in is a challenging task. You need to find an apartment/house for rent in a neighborhood that fits your criteria for transportation,safety, and nearby availability of specific venues such as grocery stores, hospitals, restuarants, entertainment, schools, and parks.

As a resident of Denver, CO, I would like to make that process easier for new-comers by segmenting the city into neighbrohoods and clustering them based on socioeconomic and location characteristics. Ideally, I'm looking to find a location similar to my current residence that is in close proximity to a grocery store, park, gym, and restaurants, public transport is a plus.

Data

Methodology

Import and Install Necessary Libraries

Let's begin by downloading and cleaning Denver's Crime Data

Executed the code below to load the local version I have stored on Github or load the most recent data from Denver's Municipal Website

I'm concerned with offenses related theft, assault, or anything else that may cause physical, fiscal, or emotional harm to others

Curious to see what kind of crimes occur at DIA (Denver International Airport)

Hmmm, intesrestig. It does make sense that some of the most common crimes in DIA are Auto-Theft, Larceny, and Theft from Vehicles. Curious to see what other neighborhoods have high number of auto-theft. Let's compare them all together!

Now, I'd like to build a Heat Map of Crime in Denver

FourSquare Location Data

Setting up FourSquarre Credentials

Notes on the Venue Categories that we are looking for

Residential Building/Apartment Complex 4d954b06a243a5684965b473
Grocery Store4bf58dd8d48988d118951735
Gym/Fitness Studio4bf58dd8d48988d175941735
Park 4bf58dd8d48988d163941735
Cafe4bf58dd8d48988d1e0931735

Let's put all of these venues in a list

Filter out "DIA and Montbello" because it produces errors for the function below

Let's create a df for each venue type and merge them together. I've had issues with certain categories or neighborhoods spitting out errors at me while using the funciton above and I don't have the braincells (yet) to write the function that would take care of all of those errors for me. So, this is what it's going to be for now.

Remove duplicates venues based on venue id.

Append Neighborhood centers to the crime heat map

Let's add all of the venues to the map to explore!

K-Means Clustering

Now, let's combine this data with Denver rental rates data. I previously completed this analyses via webscraping multiple websites with BeautifulSoup. However, the webpages that I used to scrape changed their layouts between the start of this project and this moment, so I will use a backup copy of that data.

The Elbow method showing optimal k

The graph above shows that 5 clusters will be the optimal number.

Insert Cluster Labels into the Data Frame

Quick Code for Rendering a map for the Results Section

Results and Discussion

Utilizing Pandas and FourSquare API, I combined data from different sources to cluster Denver neighborhoods into buckets based on rent, crime, and venue data. Let's explore discuss some of the results below.

Cluster Review with Candlesticks

From the graphs below we can see that:

Crime Data Review

Three of the most common crime types in Denver are: Theft from Motor Vehicle, Larceny, and Auto Theft. It appears to be common across all neighborhoods so make sure to lock your house and your car wherever you are!

Maps to Explore

Given the information above, you can use the map below to explore Denver Neighborhoods based on their cluster information and crime activity :D

Once you find the neighborhood that you like, use the map below to explore local apartment, gym, coffee shop, and parks information.

Discussion

So, are you looking to move to Denver?

I would recommend considering moving into one of the neighborhoods within cluster #0 or #3. The neighborhood that I live in is located in cluster #0 and I can personally confirm that other neighborhoods in Denver that were grouped into this cluster share similar charasteristics: higher than average rental rates but that comes with a heightened sense of safety (lower frequency of crime rates), and great walkability to nearby venues such as gyms, cofee shops, grocery stores, and parks. Neighborhoods in cluster #3 offer similar characteristics but at a lower average rental rate. Both of these clusters of neighborhoods and some of my personal recommendations to consider are: Sloans Lake, Jefferson Park, Highlands, Washington Park, and Platt Park.

Conclusion

If you are moving to Denver and looking for a new home in a neighborhood that is not in the middle of all hustling and bustling but in close proximity to a lot of great veneus, neighborhoods in cluster #0 (higher rent) and #3 (lower rent) will offer you a lot of great and safe living options. If you're looking to live in the middle of everything, cluster #1 and #2 will offer you that but make sure to stay clear of cluster #4 as it appears to have a much higher crime rate than the rest of the neighborhoods.

If-I-Were-To-Perform-This-Analysis-All-Over–Again Thoughts

References

Acknowledgments

Coursera and IBM Data Science Instructors, TAs, and Fellow Students.